﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace AnesSystem.Models
{
    public class BaseModel<T>:ObservableObject
    {
        private AccountModel lastModifyAccount;
        private DateTime lastModifyTime = DateTime.Now;

        public static T CtreatObject()
        {
            Type type = Type.GetType(HospitalConfig.Instance.CurrentHospital.ModelNameSpace + "." + typeof(T).Name);
            if (type != null)
            {
                return (T)Activator.CreateInstance(type);
            }
            else
            {
                return (T)Activator.CreateInstance<T>();
            }
        }
        public AccountModel LastModifyAccount
        {
            get
            {
                return lastModifyAccount;
            }

            set
            {
                lastModifyAccount = value;
            }
        }

        public DateTime LastModifyTime
        {
            get
            {
                return lastModifyTime;
            }

            set
            {
                lastModifyTime = value;
            }
        }
    }

    
}
